<extend name="Base/base" />

<block name="css"></block>

<!-- 主题内容区域 -->
<block name="content">
<div class="page-header">
	<h1>
		权限管理
		<small>
			<i class="icon-double-angle-right"></i>
			规则表
		</small>
	</h1>
</div><!-- /.page-header -->

<div class="row">

	<div class="col-xs-12">
	<!-- 页面内容 开始-->
		<div class="row">
			<div class="col-sm-6">
				<div id="sample-table-2_length" class="dataTables_length">
					<label>显示 
						<select size="1" name="sample-table-2_length" aria-controls="sample-table-2">
							<option value="10" selected="selected">10</option>
							<option value="25">25</option>
							<option value="50">50</option>
							<option value="100">100</option>
						</select> 
						条数
					</label>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="dataTables_filter" id="sample-table-2_filter">
					<label>搜索: <input type="text" placeholder="名称" aria-controls="sample-table-2"></label>
				</div>
			</div>
		<!-- 搜索 -->
			<div class="col-xs-12">
				<div class="table-responsive">
					<table id="sample-table-1" class="table table-striped table-bordered table-hover">
						<thead>
							<tr>
								<th class="center">
									<label>
										<input type="checkbox" class="ace" />
										<span class="lbl"></span>
									</label>
								</th>
								<th>id</th>
								<th>pid</th>
								<th class="hidden-480">名称</th>

								<th>
									<i class="icon-time bigger-110 hidden-480"></i>
									方法
								</th>
								<th class="hidden-480">状态</th>

								<th>操作</th>
							</tr>
						</thead>
					<!-- 表格的主题内容区域 -->
						<tbody>
						<foreach name="data" item="v">
							<tr>
								<td class="center">
									<label>
										<input type="checkbox" name="ids[]" value="{$v['id']}" class="ace" />
										<span class="lbl"></span>
									</label>
								</td>
								<td>
									{$v['id']}
								</td>
								<td>
									{$v['pid']}
								</td>
								<td>
									<!-- 名称 -->
									{$v['_name']}
								</td>
								<!-- 操作方法 -->
								<td>{$v['name']}</td>
								<td>{$v['status']}
									<label>
										<input value="{$v['status']}" name="switch-field-1" class="ace ace-switch" type="checkbox" onclick="changeStatus({$v['status']})">
										<span class="lbl"></span>
									</label>
								</td>
								<td>
									<div class="visible-md visible-lg hidden-sm hidden-xs btn-group">
										<!-- <button class="btn btn-xs btn-success">
											<i class="icon-ok bigger-120"></i>
										</button> -->
										
										<!-- 修改 -->
										<button class="btn btn-xs btn-info" id="show-edit" index-id="{$v['id']}">
											<i class="icon-edit bigger-120"></i>修改
										</button>

										<!-- 删除 -->
										<button class="btn btn-xs btn-danger">
											<i class="icon-trash bigger-120"></i>删除
										</button>

										<!-- <button class="btn btn-xs btn-warning">
											<i class="icon-flag bigger-120"></i>
										</button> -->
									</div>

									<!-- <div class="visible-xs visible-sm hidden-md hidden-lg">
										<div class="inline position-relative">
											<button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown">
												<i class="icon-cog icon-only bigger-110"></i>
											</button>

											<ul class="dropdown-menu dropdown-only-icon dropdown-yellow pull-right dropdown-caret dropdown-close">
												<li>
													<a href="#" class="tooltip-info" data-rel="tooltip" title="View">
														<span class="blue">
															<i class="icon-zoom-in bigger-120"></i>
														</span>
													</a>
												</li>

												<li>
													<a href="#" class="tooltip-success" data-rel="tooltip" title="Edit">
														<span class="green">
															<i class="icon-edit bigger-120"></i>
														</span>
													</a>
												</li>

												<li>
													<a href="#" class="tooltip-error" data-rel="tooltip" title="Delete">
														<span class="red">
															<i class="icon-trash bigger-120"></i>
														</span>
													</a>
												</li>
											</ul>
										</div>
									</div> -->
								</td>
							</tr>
							</foreach>
							
						</tbody>
					</table>
				</div><!-- /.table-responsive -->
			</div><!-- /span -->
			<div>	
				

		</div><!-- /row -->
	<!-- 分页开始 -->
		
		<!-- <div class="row">
			<div class="col-sm-6">
				<div class="dataTables_info" id="sample-table-2_info">
					<a href="#" class="btn btn-sm btn-success">
						<i class="icon-refresh bigger-40"></i>
						更新排序
					</a>
				</div>
			</div>
			<div class="col-sm-6">
				<div class="dataTables_paginate paging_bootstrap">
					<ul class="pagination">
						<li class="prev"><a href="#"><i class="icon-double-angle-left"></i></a></li>
						<li><a href="#">1</a></li>
						<li class="active"><a href="#">2</a></li>
						<li><a href="#">3</a></li>
						<li class="next"><a href="#"><i class="icon-double-angle-right"></i></a></li>
					</ul>
				</div>
			</div>
		</div> -->
	<!-- 页面内容 结束 -->
	</div>
</div>

</block>


<block name="js">
	<script>
		var SCOPE = {
			"del_url" : "{:U('Rule/delById')}",
			"edit_url" : "{:U('Rule/edit')}",
		};

		function changeStatus(id)
		{
			layer.open({
				content:"Are you sure?",
				icon:3,
				btn:['是','否'],
				yes:function(){
					console.log(id);
				},
			});
		}
	</script>
</block>